local mengming = fk.CreateSkill({
  name = "kq__mengming",
  tags = {Skill.Compulsory},
})

mengming:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(mengming.name)
    and data.card.is_damage_card
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local judge = {
        who = player,
        reason = mengming.name,
        pattern = ".|.|^nosuit",
    }
    room:judge(judge)
    if judge.card.color == Card.Red then
        data.use.unoffsetableList = data.use.unoffsetableList or {}
        table.insertIfNeed(data.use.unoffsetableList, player)
    elseif judge.card.is_damage_card then
        room:recastCard(player:getCardIds("h"), player, mengming.name)
    end
  end,
})

mengming:addEffect(fk.TargetConfirmed, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(mengming.name)
    and data.card.is_damage_card
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local judge = {
        who = player,
        reason = mengming.name,
        pattern = ".|.|^nosuit",
    }
    room:judge(judge)
    if judge.card.color == Card.Red then
        data.use.unoffsetableList = data.use.unoffsetableList or {}
        table.insertIfNeed(data.use.unoffsetableList, player)
    elseif judge.card.is_damage_card then
        room:recastCard(player:getCardIds("h"), player, mengming.name)
    end
  end,
})

Fk:loadTranslationTable {
["kq__mengming"] = "蒙明",
[":kq__mengming"] = "锁定技，当你使用伤害牌指定目标后，或成为伤害牌的目标后，进行一次判定，若结果为<br>"..
"伤害牌，你重铸所有手牌；<br>"..
"红色牌，此牌无法被响应。",
["$kq__mengming1"] = "大河将竭，桃园霜落，夸父岂存畏死之心。",
["$kq__mengming2"] = "棘路万里，雄关亘原，今乃迈步之始。",
}

return mengming